#@layout()

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            元信息编辑
            <small>Article Meta Edit</small>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header ">
                        <h3 class="box-title"></h3>
                    </div>
                    <form class="form-horizontal form-setting autoAjaxSubmit"  autocomplete="off"
                          action="#(CPATH)/admin/article/meta/doSave"
                          method="POST"
                          data-ok-href="#(CPATH)/admin/article/meta"
                    >
                        <input type="hidden" name="meta.id" value="#(meta.id ??)">
                        <div class="box-body ">

                            <div class="form-group">
                                <label class="col-sm-2 control-label">名称</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="请填写该元信息的名称..."
                                           value="#(meta.label ??)" name="meta.label">
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">Id属性值</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="ID属性值..."
                                           value="#(meta.field_id ??)" name="meta.field_id">
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">Name属性值</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="Name属性值..."
                                           value="#(meta.field_name ??)" name="meta.field_name">
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">占位符内容</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="占位符内容..."
                                           value="#(meta.placeholder ??)" name="meta.placeholder">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">类型</label>
                                <div class="col-sm-6">
                                    <select class="form-control" name="meta.type">
                                        <option value="input" #selectedIf(meta && meta.type == 'input') >输入框</option>
                                        <option value="textarea" #selectedIf(meta && meta.type == 'textarea') >文本框（多行输入）</option>
                                        <option value="select" #selectedIf(meta && meta.type == 'select') >下拉选择框</option>
                                        <option value="checkbox" #selectedIf(meta && meta.type == 'checkbox') >复选框</option>
                                        <option value="radio" #selectedIf(meta && meta.type == 'radio') >单选框</option>
                                        <option value="switch" #selectedIf(meta && meta.type == 'switch') >开关按钮</option>
                                        <option value="date" #selectedIf(meta && meta.type == 'date') >日期选择器</option>
                                        <option value="datetime" #selectedIf(meta && meta.type == 'datetime') >时间选择器</option>
                                    </select>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">Value值（列表）</label>
                                <div class="col-sm-6">
                                    <textarea rows="3" class="form-control"
                                              placeholder="..."
                                              name="meta.value">#(meta.value ??)</textarea>
                                    <p class="help-block"> 多个值用英文逗号（,）隔开，下拉选择框、复选框和单选框可能需要填写多个值。 </p>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">Value值文本</label>
                                <div class="col-sm-6">
                                    <textarea rows="3" class="form-control"
                                              placeholder="..."
                                              name="meta.value_text">#(meta.value_text ??)</textarea>
                                    <p class="help-block"> 务必要保证和以上填写的 <b>Value值（列表）</b> 数量上保持一致。 </p>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">排序</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="此分类排序的序号"
                                           value="#(meta.order_no ??)"
                                           name="meta.order_no">
                                    <p class="help-block"> 越小的数字越靠前。 </p>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">其他属性</label>
                                <div class="col-sm-6">
                                    <textarea rows="3" class="form-control"
                                              placeholder="..."
                                              name="meta.attrs">#(meta.attrs ??)</textarea>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">备注</label>
                                <div class="col-sm-6">
                                    <textarea rows="3" class="form-control"
                                              placeholder="..."
                                              name="meta.remarks">#(meta.remarks ??)</textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">启用</label>
                                <div class="col-sm-6">
                                    <input type="checkbox" class="switchery" data-for="meta_enable" #checkedIf(meta && meta.enable)>
                                    <input type="hidden" id="meta_enable" name="meta.enable">
                                </div>
                            </div>

                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="col-sm-offset-2 col-sm-10 submit-block">
                                <div class="box-submit">
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>

    </section>

</div>
#end
